package com.ikun.mapper;

import com.ikun.pojo.Tb_Recharge;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;

public interface TbRechargeMapper {
    //创建订单
    @Insert("INSERT into tb_recharge (recharge_money,recharge_order,uid) " +
            "VALUES (#{recharge_money},#{recharge_order},#{uid});")
    public int createRecharge(@Param("recharge_money") BigDecimal recharge_money,
                              @Param("recharge_order")String recharge_order,
                              @Param("uid")Long uid);

    @Select("SELECT * FROM tb_recharge WHERE recharge_state = 1 and " +
            "recharge_order = #{recharge_order}")
    public Tb_Recharge selectRechargeByOrder(@Param("recharge_order")String recharge_order);
}
